Skip to content

fix: skip extended API contract tests when endpoints unavailable#398

Merged
hsteude merged 1 commit into
mainfrom
issue-396
May 13, 2026
Merged

fix: skip extended API contract tests when endpoints unavailable#398
hsteude merged 1 commit into
mainfrom
issue-396

Conversation

@hsteude
Copy link
Copy Markdown
Contributor

@hsteude hsteude commented May 4, 2026

Summary

  • Adds a beforeAll check in the "Extended API" describe block that probes /api/ext/saved-prompts for JSON response
  • If the extended endpoints aren't available (backend returns HTML/404), all extended API tests skip gracefully
  • Tests still validate fully when run against the dev/production server

Closes #396

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the API contract smoke tests to detect whether “Extended API” endpoints are actually available on the configured OPENCODE_URL target, and to skip the extended endpoint assertions when the target server responds with the backend’s HTML/SPA fallback instead of JSON (addressing #396).

Changes:

  • Add an Extended API beforeAll probe to /api/ext/saved-prompts and treat the extended API as available only when it returns application/json.
  • Gate all extended API tests behind skipIfNoExtendedApi() to avoid JSON parse failures / incorrect assertions when hitting the backend directly.
  • Print a one-time warning explaining why extended tests are being skipped when unavailable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hsteude hsteude merged commit c4a5356 into main May 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix saved-prompts API contract tests failing against backend

2 participants